package com.ls.controller;


import com.ls.base.BaseResult;
import com.ls.controller.model.channelIn.AddChannelInModel;
import com.ls.controller.model.channelIn.QueryChannelInModel;
import com.ls.controller.model.serviceIn.AddServiceInModel;
import com.ls.controller.model.serviceIn.QueryServiceInModel;
import com.ls.entity.SysUser;
import com.ls.service.ISmsChannelInService;
import com.ls.service.ISmsServiceInService;
import com.ls.utils.login.CurrentUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;

/**
 * <p>
 *  业务短信入库
 * </p>
 *
 * @author pengyu
 * @since 2019-12-05
 */
@Api(value = "业务短信入库接口", description = "业务短信入库接口")
@Controller
@RequestMapping("/smsServiceIn")
public class SmsServiceInController {

    @Autowired
    ISmsServiceInService service;

    /**
     * 新增
     */
    @ApiOperation(value = "新增入库")
    @PostMapping(value = "add")
    @ResponseBody
    public BaseResult add(@Valid @RequestBody AddServiceInModel model, @CurrentUser SysUser currentUser) {
        return service.add(model, currentUser);
    }

    /**
     * 分页查询记录
     */
    @ApiOperation(value = "分页查询记录，按当前设计，只查询单个业务的入库分页记录")
    @PostMapping(value = "list")
    @ResponseBody
    public BaseResult list(@Valid @RequestBody QueryServiceInModel model, @CurrentUser SysUser currentUser) {
        return service.list(model, currentUser);
    }

}

